package com.neu.envprotection.feedback.controller;

import com.neu.envprotection.common.constant.SystemConfigConsts;
import com.neu.envprotection.common.resp.RestResp;
import com.neu.envprotection.feedback.dao.entity.Rank;
import com.neu.envprotection.feedback.dto.resp.ReportChinaChartsRespDto;
import com.neu.envprotection.feedback.service.SupervisorService;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.security.SecurityRequirement;
import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/api/inner")
@RequiredArgsConstructor
@SecurityRequirement(name = SystemConfigConsts.HTTP_AUTH_HEADER_NAME)
@Tag(name = "内部接口")
@Slf4j
public class InnerController {

    @Autowired
    private SupervisorService supervisorService;

    @PostMapping("/rank/selectRanks")
    @Operation(summary = "获取所有rank")
    RestResp<List<Rank>> storeVerifyCode(){
        return supervisorService.showAllRanks();
    }

    @PostMapping("/supervisor/getProvinceAQI")
    @Operation(summary = "获取所有AQI")
    RestResp<List<ReportChinaChartsRespDto>> getProvinceAQI(){
        return supervisorService.getProvinceAQI();
    }
}
